package Month07.day03;

import java.util.Scanner;

public class array6 {
    public static void main(String[] args) {
        int[] ints = new int[6];
        Scanner scanner = new Scanner(System.in);
        for (int i = 0; i < ints.length; i++) {
            System.out.println("请输入第"+(i+1)+"个评委的打分！");
            int number=scanner.nextInt();
            if (number>=0&&number<=100){
                ints[i]=number;
            }else {
                System.out.println("输入的分数有误！");
                i--;
            }
        }
        int max=ints[0];
        for (int i = 0; i < ints.length; i++) {
            if (max<ints[i]){
                max=ints[i];
            }
        }
        int min=ints[0];
        for (int i = 0; i < ints.length; i++) {
            if (min>ints[i]){
                min=ints[i];
            }
        }
        int sum=0;
        for (int i = 0; i < ints.length; i++) {
            sum+=ints[i];
        }
        int avg=(sum-max-min)/4;
        System.out.println(avg);
    }
}
